<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<%@ include file="/WEB-INF/views/include/head.jsp"%>
<link rel="stylesheet" href="${ctxStatic}/css/list.css">
<title><spring:message code="bigcargo_style_list" /></title>
<script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
<script src="${ctxStatic}/dateCalendar/WdatePicker.js"></script>
 <script src="${ctxStatic}/js/style.js"></script>
 <script src="${ctxStatic}/layer/layerStyle.js"></script>
<script>
	// 检索方法
	function searchListForm() {
		var styleNo = $("#styleNo").val();
		var ognizationName = $("#ognizationName").val();
		var styleCateGoryCd = $("#styleCateGoryCd").val();
		var dateFrom = $("#dateFrom").val();
		var dateTo = $("#dateTo").val();
		var userId = $("#userId").val();
		$("#activity_pane").showLoading();
		$.post("${ctx}/bigcargo/style/searchList?styleNo=" + styleNo + "&ognizationName=" + ognizationName
				+ "&styleCateGoryCd=" + styleCateGoryCd + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo, "",
				function(result) {
					var listHtml = result["bigcargoStyle"];
					var pageHtml = result["page"];
					$("#listHtml").html(listHtml);
					$("#paging").html(pageHtml);
					thumbnail();
					$("#activity_pane").hideLoading();
				}, 'json');
	}
	function toCreateImage(index) {
		var customerStyleNo = $("#listHtml").find(".customerStyleNo").eq(index).val();
		var styleNameCn = $("#listHtml").find(".styleNameCn").eq(index).val();
		var styleColor = $("#listHtml").find(".styleColor").eq(index).val();
		var styleYear = $("#listHtml").find(".styleYear").eq(index).val();
		var refStyleID = $("#listHtml").find(".refStyleID").eq(index).val();
		var refStyleNo = $("#listHtml").find(".refStyleNo").eq(index).val();
		var styleRemark = $("#listHtml").find(".styleRemark").eq(index).val();
		var styleTempSeason = $("#listHtml").find(".styleTempSeason").eq(index).val();
		var styleStyleGroupCd = $("#listHtml").find(".styleStyleGroupCd").eq(index).val();
		var styleTemp = $("#listHtml").find(".styleTemp").eq(index).val();
		var styleOgnizaitonTemp = $("#listHtml").find(".styleOgnizaitonTemp").eq(index).val();
		var uploadFile = $("#listHtml").find(".uploadFile").eq(index).val();
		var styleID = $("#listHtml").find(".styleID").eq(index).val();
		var ognizationId = $("#listHtml").find(".ognizationId").eq(index).val();
		var brandId = $("#listHtml").find(".brandId").eq(index).val();
		var selectCode = styleTemp.split("-");
		var url = "?styleID="+styleID+"&customerStyleNo="+customerStyleNo+"&styleNameCn="+styleNameCn+"&refStyleID="+refStyleID+"&refStyleNo="+refStyleNo
				+"&styleColor="+styleColor+"&styleYear="+styleYear+"&styleStyleGroupCd="+styleStyleGroupCd
				+"&styleTemp="+styleTemp+"&styleOgnizaitonTemp="+styleOgnizaitonTemp+"&styleRemark="+styleRemark
				+"&uploadFile="+uploadFile+"&styleTempSeason="+styleTempSeason+"&bigcargoCustomer="+ognizationId
				+"&brandId="+brandId+"&popupCategoryCd="+(selectCode[1]+"_FIT_ITEM");
		popup('1000px','600px','${ctx}/bigcargo/style/createStyle'+url);
	}
	// 重置方法
	function clearParam() {
		$("#styleNo").val("");
		$("#ognizationName").val("");
		$("#styleCateGoryCd").val("");
		// 下拉选框带搜索功能
		$("#styleCateGoryCd").select2();
		var dateFrom = $("#dateFrom").val("");
		var dateTo = $("#dateTo").val("");
		var userId = $("#userId").val("");
		searchListForm();
	}
</script>
<style type="text/css">
 .trHeight{
 	height: 65px;
 }
 
 .imgSize{
 	width: 65px;
 	height: 65px;
 }
 
 .imgSizeBig{
 	width: 165px;
 	height: 165px;
 }

</style>
</head>
<body>
	<div class="listArea" id="activity_pane">
		<div class="listBg">
			<div class="searchArea clearfix">
				<div class="searchLeft clearfix">
					<div class="searchInp clearfix">
						<!-- 款号 -->
						<p>
							<spring:message code="bigcargo_model_no" />
						</p>
						<input class="w-styleNub" id="styleNo" name="styleNo">
					</div>
					<div class="searchInp clearfix">
						<!-- 客户 -->
						<p>
							<spring:message code="bigcargo_customer" />
						</p>
						<input class="w-customer" id="ognizationName"
							name="ognizationName">
					</div>
					<div class="searchInp clearfix">
						<!-- 款式类别 -->
						<p>
							<spring:message code="bigcargo_style_model" />
						</p>
						<select class="w-styleCategory" id="styleCateGoryCd"
							name="styleCateGoryCd" style="width: 150px">
							<option value=""><spring:message
									code="order_please_choose" /></option>
							<c:forEach items="${styleList}" var="item">
								<option value="${item.itemCode}-${item.itemValue}">${item.itemName}</option>
							</c:forEach>
						</select>
					</div>
					<div class="searchInp clearfix">
						<!-- 日期 -->
						<p>
							<spring:message code="bigcargo_date" />
						</p>
						<div class="timeBox">
							<input type="text" class="laydate-icon" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})"
								id="dateFrom" name="dateFrom" style="width: 110px">
							<p class="list">~</p>
							<input type="text" class="laydate-icon" id="dateTo" name="dateTo"
								style="width: 110px" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})">
						</div>
					</div>
				</div>
				<div class="searchRight clearfix">
				 <shiro:hasPermission name="bigcargostyle:message:view">
					<!-- 检索 -->
					<button onclick="searchListForm()">
						<spring:message code="commom_check" />
					</button>
					</shiro:hasPermission>
					<!-- 重置 -->
					<button onclick = "clearParam()">
						<spring:message code="common_reset" />
					</button>
					<shiro:hasPermission name="bigcargostyle:message:edit">
					<!-- 创建 -->
					<button onclick="popup('1000px','600px','${ctx}/bigcargo/style/createStyle?otherImageFlg=bigCargoStyle')">
						<spring:message code="common_create" />
					</button>
					</shiro:hasPermission>
					<!-- 导出 -->
					<%-- <button>
						<spring:message code="common_export" />
					</button> --%>
					
				</div>
			</div>
			<div class="tableArea">
				<div class="tableScrollSm" style="overflow: auto;width: 1690px;height: 714px; ">
					<table cellpadding="0" class="tableHead">
						<thead>
							<tr>
								<!-- No. -->
								<th><p class="table-No">
										<spring:message code="common_no" />
									</p></th>
								<!-- 款式图片 -->
								<th><p class="width-80px">
										<spring:message code="bigcargo_style_stylePictures" />
									</p></th>
								<!-- 款号/款式名称 -->
								<th><p class="width-230px">
										<spring:message code="bigcargo_no_name" />
									</p></th>
								<!-- 款式类别 -->
								<th><p class="width-140px">
										<spring:message code="bigcargo_styleCategory" />
									</p></th>
								<!-- 面料 -->
								<th><p class="width-140px">
										<spring:message code="bigcargo_style_fabric" />
									</p></th>
								<!-- 版型 -->
								<th><p class="width-140px">
										<spring:message code="bigcargo_size_styleFit" />
									</p></th>
								<!-- 年份季节 -->
								<th><p class="width-140px">
										<spring:message code="bigcargo_style_yearAndSeason" />
									</p></th>
								<!-- 客户 -->
								<th><p class="width-230px">
										<spring:message code="bigcargo_customerName" />
									</p></th>
								<!-- 合同订单号 -->
								<th><p class="width-230px">
										<spring:message code="bigcargo_indentNo" />
									</p></th>
								<!-- 创建者 -->
								<th><p class="width-140px">
										<spring:message code="bigcargo_creater" />
									</p></th>
								<!-- 创建日期 -->
								<th><p class="width-140px">
										<spring:message code="bigcargo_create_date" />
									</p></th>
							</tr>
						</thead>
					</table>
					<table cellpadding="0" class="tableBody">
						<tbody id="listHtml">
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<div id="paging"></div>
	</div>
	<script type="text/javascript">
		$(document).ready(function() {
			// 下拉选框带搜索功能
			$("#styleCateGoryCd").select2();
			searchListForm();
			
		});
	</script>
</body>
</html>
